package com.lemon.cloud.websocket.message;

import lombok.Data;

import java.util.List;

@Data
public class MessageDO {
    /**
     * 是否广播
     */
    private Boolean needBroadcast;
    /**
     * to用户
     */
    private List<Object> sessionKeys;
    /**
     * 消息内容
     */
    private String messageText;

    /**
     * type
     */
    private String type;

    @Override
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof MessageDO)) {
            return false;
        } else {
            MessageDO other = (MessageDO)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                label47: {
                    Object this$needBroadcast = this.getNeedBroadcast();
                    Object other$needBroadcast = other.getNeedBroadcast();
                    if (this$needBroadcast == null) {
                        if (other$needBroadcast == null) {
                            break label47;
                        }
                    } else if (this$needBroadcast.equals(other$needBroadcast)) {
                        break label47;
                    }

                    return false;
                }
                Object this$sessionKeys = this.getSessionKeys();
                Object other$sessionKeys = other.getSessionKeys();
                if (this$sessionKeys == null) {
                    if (other$sessionKeys != null) {
                        return false;
                    }
                } else if (!this$sessionKeys.equals(other$sessionKeys)) {
                    return false;
                }

                Object this$messageText = this.getMessageText();
                Object other$messageText = other.getMessageText();
                if (this$messageText == null) {
                    if (other$messageText != null) {
                        return false;
                    }
                } else if (!this$messageText.equals(other$messageText)) {
                    return false;
                }
                return true;
            }
        }
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }

    protected boolean canEqual(final Object other) {
        return other instanceof MessageDO;
    }

}
